package com.ddxz.demo.clickhouse.mapper;

import com.ddxz.demo.clickhouse.entity.ClickHouseEntity;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Map;

/**
 * description
 *
 * @author 朱宗刚
 * @version 1.0.0
 * @date 2021/3/22
 */

@Mapper
@Repository
public interface ClickHouseMapper {
    Page<Map<String, Object>> getPageList();

    /**
     * 插入基线数据
     * @param seconds 精确到秒的时间戳
     * @return 是否失败
     */
    Integer insertCountryRoamElement(@Param("sec") Long seconds);

    ClickHouseEntity getEntityByIdAndVersion(@Param("id") Long id, @Param("version") Long version);

    Integer updateVersionMergeTree(@Param("oldVal") ClickHouseEntity oldVal, @Param("newVal") ClickHouseEntity newVal);
}
